<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>TitgetElementByTagName.htmlle</title>
</head>
<body>
<h1 class="p">hello javascript</h1>
<h2 class="p" >hello wrold</h2>
<p class="p">hello getElementByTagName</p>
<script type="text/javascript">
    var arr = document.getElementsByClassName("p");
    console.log(arr);

    for(var i=0;i<arr.length;i++){
        document.write(arr[i]);
        console.log(arr[i]);
        document.write("<br />")
    }
</script>
</body>
</html>